//
//  ChartingImageNumberView.m
//  intelligent
//
//  Created by 甘世清 on 2024/3/2.
//

#import "ChartingImageNumberView.h"

@implementation ChartingImageNumberView

- (void)SQ_UIViewForSelfView{
    UIView * bgView = [[UIView alloc]init];
    
    bgView.backgroundColor = UIColor.whiteColor;
    bgView.layer.cornerRadius = 16;
    bgView.layer.masksToBounds = YES;
    bgView.clipsToBounds = YES;
    [self addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.centerY.equalTo(self);
        make.width.mas_equalTo(SCREEN_WIDETH-55);
        make.height.mas_equalTo(162);
    }];
    UIImageView * image = [[UIImageView alloc]init];
    image.image = SQGetImage(@"sorry");
    image.backgroundColor = UIColor.clearColor;
    image.contentMode = UIViewContentModeScaleAspectFit;
    [self addSubview:image];
    [image mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(152);
        make.height.mas_equalTo(62);
        make.centerX.equalTo(self);
        make.top.equalTo(bgView).offset(-25);
    }];
    
    self.messageLabel=[[UILabel alloc]init];
    self.messageLabel.numberOfLines = 0;
    self.messageLabel.textAlignment = NSTextAlignmentCenter;
    self.messageLabel.font = FONT_REGULAR(18);
    self.messageLabel.textColor = SQColor333333;
    [bgView addSubview:self.messageLabel];
    [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(image);
            make.top.equalTo(image.mas_bottom).offset(25);
    }];
    [bgView addSubview:self.leftBtn];
    [self.leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.bottom.equalTo(bgView);
        make.height.mas_equalTo(44);
    }];
}

- (SQCustomButton *)leftBtn{
    if (!_leftBtn) {
        _leftBtn = [[SQCustomButton alloc]initType:SQCustomButtonTopImageType imageSize:CGSizeMake(0, 0) midmargin:0];
        _leftBtn.text = SQNSLocalString(@"好的");
        _leftBtn.textColor = SQColor333333;
        _leftBtn.font = FONT_REGULAR(18);
        _leftBtn.backgroundColor = SQColor(@"#4AF8CE");
    }
    return _leftBtn;
}
@end
